package br.com.fiap.agenteDialogo.BLL;

import java.util.ArrayList;

import javax.swing.JOptionPane;

import org.apache.commons.collections15.Factory;
import br.com.fiap.agenteDialogo.Beans.Edge;

public class EdgeFactory implements Factory<Edge> {

	private int n = 1;
	
	@Override
	public Edge create() {
		
		Edge e = new Edge(n++);
		
		ArrayList<String> frases = new ArrayList<>();
		
		String[] lFrases =  JOptionPane.showInputDialog(null, "Insira as frases utilizando ; no final: ", "GraphEditor", 1).split(";");
		
		for (String string : lFrases) {
			frases.add(string);
		}
		
		e.setValue(frases.toString());
		
		return  (e);
	}

}
